package com.rede.didiok.admin.restapi.admin;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rede.didiok.admin.annotion.AuthorityVerify.AuthorityVerify;
import com.rede.didiok.common.dto.user.WebVisitDto;
import com.rede.didiok.common.exception.ThrowableUtils;
import com.rede.didiok.common.feign.UserFeignClient;
import com.rede.didiok.common.validator.group.GetList;

/**
 * 用户访问表 RestApi
 *
 * @author Rede
 * @date 2023年7月17日08:38:09
 */
@Api(value = "用户访问相关接口", tags = {"用户访问相关接口"})
@RestController
@RequestMapping("/admin/webVisit")
@Slf4j
public class WebVisitRestApi {

    @Autowired
    private UserFeignClient userFeignClient;

    @AuthorityVerify
    @ApiOperation(value = "获取用户访问列表", notes = "获取用户访问列表")
    @PostMapping("/getList")
    public String getList(@Validated({GetList.class}) @RequestBody WebVisitDto webVisitDto, BindingResult result) {

        // 参数校验
        ThrowableUtils.checkParamArgument(result);
        return userFeignClient.getWebVisitPageList(webVisitDto);
    }
}

